<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="referrer" content="no-referrer" />
    <title>飞线</title>
    <style>
        body {
            position: absolute;
            margin: 0;
            width: 100%;
            height: 100%;
        }

        #mapContainer {
            left: 0px;
            top: 0px;
            width: 100%;
            height: 100%;
            float: left;
        }
    </style>
</head>

<body>
    <div id="mapContainer" style="position: relative;"></div>
</body>
<script src='/GiswayEngine.js'></script>
<script type="text/javascript">
    window.app = new GE.App('mapContainer', {
        position: [118.72302471900817, 32.00261074543409, 4000], //相机的位置
        lookAt: [118.72302471900817, 32.00261074543409, 0], //相机看向的地图位置
        // position: [120.14722331340128, 30.27129365792725, 1000], //相机的位置
        // lookAt: [120.14722331340128, 30.27129365792725, 0], //相机看向的地图位置
        cameraScrollSpeed: 5, //鼠标滚动时，控制相机移动的速度
        minZoom: 3, //允许地图的最小层级
        maxZoom: 20, //允许地图的最大层级
        ambientLightIntensity: 5,
        isOpenFlyline: true,  //开启飞线的功能
        useDefaultTexture: true, //是否使用瓦片默认纹理
        background: "Fog", //背景的类型，参数有如下类型：None, Fog, Color, Gradient, Image, Sky, Image。使用Fog地图的性能会比较好
        // backGroundColorA:'#AAAAFF', //当background的值为Gradient时，需要配置该参数。最下端颜色，默认值为#0000FF
        // backGroundColorB:'#0000FF', //当background的值为Gradient时，需要配置该参数。最上端颜色，默认值为#FF0000
        // backGroundColor: '#F5F5F5', //当background的值为Color时，需要配置该参数，默认值为#00BFFF
        // imageUrl: 'http://localhost:9000/examples/assets/img_logo.39362dc1.png', //当background的值为Image时，需要配置该参数。默认值为null
        baseLayer: [
            //影像底图
            {
                url: ' https://server.arcgisonline.com/arcgis/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', //影像底图的url
                // url: 'http://115.236.87.26:8848/googleTiles/china_image/{z}/{y}/{x}.jpg',
                urlDecimal: true, //影像底图url中的瓦片行列号是否是十进制，true表示十进制，false表示十六进制
                tileType: 'image', //影像底图
                canNotSelect: false, //true表示该图层不参与射线拾取，false表示图层参与射线拾取
            }
        ]
    });

    addFlyLine();

    function addFlyLine() {
        let flyline = new GE.FlyLine({
            positions: [
                new GE.Point(118.72302471900817, 32.00261074543409, 0),
                new GE.Point(118.72384394532999, 31.993274830381445, 500),
                new GE.Point(118.72516374995796, 31.98390338734335, 0)
            ]
        });
        app.add(flyline);

        let flyline2 = new GE.FlyLine({
            positions: [
                new GE.Point(118.72302471900817, 32.00261074543409, 0),
                new GE.Point(118.73617243720062, 32.00647300579018, 500),
                new GE.Point(118.74883688061205, 32.010723321406324, 0)
            ]
        });
        app.add(flyline2);

        let flyline3 = new GE.FlyLine({
            positions: [
                new GE.Point(118.72302471900817, 32.00261074543409, 0),
                new GE.Point(118.7219288598545, 32.012735472418825, 500),
                new GE.Point(118.72139179556089, 32.02011730432809, 0)
            ]
        });
        app.add(flyline3);
    }

</script>

</html>